package org.gl.demoswig;

import org.gl.demoswig.jni.Unix;
import org.gl.demoswig.jni.ko_byte_array_t;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {
    static {
        System.loadLibrary("DemoSWIG");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ko_byte_array_t array = new ko_byte_array_t();
        final byte[] bytes = "geliang 发射点发立法手段来看 ".getBytes();
        array.setSize(bytes.length);
        array.setBYTE(bytes);
        Unix.setuserids(array);
    }
}

// %typemap(jni) signed char *ko_bytearray "jbyteArray"
// %typemap(jtype) signed char *ko_bytearray "byte[]"
// %typemap(jstype) signed char *ko_bytearray "byte[]"
// %typemap(javaout) signed char *ko_bytearray {
// return $jnicall;
// }
//
// %typemap(out) signed char * ko_bytearray {
// $result = JCALL1(NewByteArray, jenv, arg1->size);
// JCALL4(SetByteArrayRegion, jenv, $result, 0, arg1->size, $1);
// }
//
// // Optional: ignore contentLength;
// //%ignore size;
//
// %inline %{
// typedef struct {
// signed char * ko_bytearray;
// int size;
// } Foo;
// %}
